CREATE TABLE jms_dm.dm_waybill_customer_complaint_delivery_agg_new_dt
(
    delivery_code         varchar(50) comment '派件员',
    network_code          varchar(50) comment '网点',
    agent_code            varchar(50) comment '代理区code',
    regional_code         varchar(50) comment '大区',
    regional_desc         varchar(100) comment '大区',
    network_name          varchar(100) comment '网点',
    fran_code             varchar(50) comment '加盟商code',
    fran_name             varchar(100) comment '加盟商name',
    agent_name            varchar(100) comment '代理区name',
    virt_code             varchar(50) comment '虚拟代理区code',
    virt_name             varchar(100) comment '虚拟代理区name',
    zone_id               varchar(50) comment '网管片区负责人id',
    zone_code             varchar(50) comment '网管片区负责人code',
    zone_name             varchar(100) comment '网管片区负责人name',
    sys_area_id           varchar(50) comment '网管父片区id',
    parent_area_code      varchar(50) comment '网管父片区域code',
    parent_area_name      varchar(100) comment '网管父片区域name',
    area_code             varchar(50) comment '区域',
    area_name             varchar(100) comment '区域',
    network_type          varchar(50) comment '网点类型',
    delivery_name         varchar(100) comment '派件员',
    is_virtual_agent      varchar(50) comment '1是虚拟代理区,2不是',
    work_cnt              int comment '普通(呼叫中心)客诉量',
    project_cnt           int comment '平台客诉量',
    appeal_cnt            int comment '邮政客诉量',
    claim_cnt             int comment '理赔客诉量',
    third_platform_cnt    int comment '第三方客诉量',
    transfer_cnt          int comment '转运客诉量',
    network_cnt           int comment '网点客诉量',
    all_cnt               int comment '4种工单量相加',
    taking_cnt            int comment '网点收件量',
    arrival_cnt           int comment '网点到件量',
    xijia_sign_num        int comment '派件员普通工单虚假签收',
    over_time_num         int comment '派件员普通工单超时效催件',
    have_take_no_send_num int comment '派件员普通工单有揽未发',
    no_send_door_num      int comment '派件员普通工单不送货上门',
    service_attitude_num  int comment '派件员普通工单服务态度',
    money_problem_num     int comment '派件员普通工单费用问题',
    out_complaint_num     int comment '派件员普通工单外投诉意向',
    compensate_num        int comment '派件员普通工单赔偿意向',
    reback_transfer_num   int comment '派件员普通工单退转件票数',
    center_op             int comment '中心操作量',
    effic_num             int comment '时效签收量',
    date_time             date comment '明细的dt,是create_time,统计的是t-1的数据'
) ENGINE=OLAP
DUPLICATE KEY(delivery_code,network_code)
COMMENT "客诉派件员"
PARTITION BY RANGE(date_time)
(
START ('2023-12-01') END ('2024-02-01') EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(delivery_code) BUCKETS 1
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "2",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);
